package com.xpec.cipher.tals.record;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;

import com.xpec.cipher.tals.TalsConstance;

public class ChangeCipherSpecRecord extends TalsRecord
{
	private byte[] verifyData = null;
	
	public ChangeCipherSpecRecord(byte[] verifyData)
	{
		this.verifyData = verifyData;
	}
	
	@Override
	protected int getContentLength()
	{
		return TalsConstance.CHANGE_CIPHER_VERIFY_DATA_SIZE;
	}

	@Override
	protected byte getContentType()
	{
		return TalsConstance.CONTENT_TYPE_CHANGE_CIPHER_SPEC;
	}

	@Override
	protected ChannelBuffer resolveSubStruct()
	{
		return ChannelBuffers.wrappedBuffer(verifyData,0,TalsConstance.CHANGE_CIPHER_VERIFY_DATA_SIZE);
	}

}
